const http = require('http')
const fs = require('fs')

const server = http.createServer((req,res)=>{
    // 获取路径
    let path = req.url;
    if(path === "/"){
        res.end('Hello Word')
    }
    else if(path==="/login"){
        res.end('login')
    }else if(path === "/reg"){
        res.end('reg')
    }else{
        res.end('没有页面给你响应')
    }
    
})

server.listen(3000,()=>{
    console.log("服务器启动成功.... at http:/127.0.0.1:3000");
})